package com.microsoft.mcp.sample.server;

import com.microsoft.mcp.sample.server.service.McpKnowledgeService;
import org.springframework.ai.tool.ToolCallbackProvider;
import org.springframework.ai.tool.method.MethodToolCallbackProvider;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import com.microsoft.mcp.sample.server.service.CalculatorService;

@SpringBootApplication(scanBasePackages = "com.microsoft.mcp.sample.*")
public class McpServerApplication {

	public static void main(String[] args) {
		SpringApplication.run(McpServerApplication.class, args);
	}
	
	@Bean
	public ToolCallbackProvider calculatorTools(CalculatorService calculator,McpKnowledgeService knowledgeService) {
		return MethodToolCallbackProvider.builder()
				.toolObjects(knowledgeService,calculator)
				.build();
	}

}
